package com.pyue.eam.app.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pyue.eam.admin.api.dto.SimpleUserInfo;
import com.pyue.eam.app.api.dto.AppUserDTO;
import com.pyue.eam.app.api.entity.AppUser;
import com.pyue.eam.app.api.vo.AppUserVO;
import com.pyue.eam.common.data.datascope.EamBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * app用户表
 *
 * @author aeizzz
 * @date 2022-12-07 09:52:03
 */
@Mapper
public interface AppUserMapper extends EamBaseMapper<AppUser> {

	IPage<AppUserVO> getUserVosPage(Page page, @Param("query") AppUserDTO appUserDTO);

	AppUserVO getUserVoById(Long userId);

	void updateUserRoleType(@Param("roleTypeId") String roleTypeId, @Param("userId") Long userId);

	String getAvatarByUserId(@Param("userId") String userId);

	@InterceptorIgnore(tenantLine = "true")
	Long getRoleTypeIdByUserId(@Param("userId") Long userId);

	List<String> getWxOpenIdByMiniOpenId(@Param("miniOpenIdList") List<String> miniOpenIdList);

	List<String> getWxOpenIdByAppUserId(@Param("userIdList") List<Long> userIdList);

	// 所有的团长微信OpenId
	List<String> getAllRegiWxOpenId();

	String getNameById(@Param("userId") String userId);

    List<Long> getAllRegiUserId();

	List<SimpleUserInfo> simpleUserListByIdList(@Param("userIdList") List<Long> userIdList);

}
